#include "StdAfx.h"
#include "btime.h"
#include "machine/BurgerTimeMachine.h"

static dip_t dip1[] =
	{
	{"Coin 1",2,3,{{"2 coins/1 credit",0},{"1 coin/3 credits",1},{"1 coin/2 credits",2},{"1 coin/1 credit",3}}},
	{"Coin 2",2,0xC,{{"2 coins/1 credit",0},{"1 coin/3 credits",4},{"1 coin/2 credits",8},{"1 coin/1 credit",0xC}}},
	{"Service",1,0x10,{{"on",0},{"off",0x10}}},
	{"Cross Hatch",1,0x20,{{"on",0},{"off",0x20}}},
	{"Cabinet type",1,0,{{"upright",0},{"cocktail",0x40}}},
	{"VBlank",-1,0,{{"off",0},{"on",0x80}}},
	{0,0,0,0,0}	
	};

static dip_t dip2[] =
	{
	{"Lives",1,1,{{"5",0},{"3",1}}},
	{"Bonus life",2,6,{{"30,000",0},{"20,000",2},{"15,000",4},{"10,000",6}}},
	{"Enemies",1,8,{{"6",0},{"4",8}}},
	{"End of level pepper",1,0,{{"on",0},{"off",0x10}}},
	{"Unknown",1,0,{{"off",0},{"on",0x20}}},
	{"Unknown",1,0,{{"off",0},{"on",0x40}}},
	{"Unknown",1,0,{{"off",0},{"on",0x80}}},
	{0,0,0,0,0}	
	};

InputPort btimePort1 =
	{
		{
		{"Right",	I_RIGHT,		0x01,	I_LOW},
		{"Left",		I_LEFT,		0x02,	I_LOW},
		{"Up",		I_UP,			0x04,	I_LOW},
		{"Down",		I_DOWN,		0x08,	I_LOW},
		{"Button 1",I_B1,			0x10,	I_LOW},
		{"Unknown",	0,				0x20,	I_LOW},
		{"Unknown",	0,				0x40,	I_LOW},
		{"Unknown",	0,				0x80,	I_LOW},
		}
	};

InputPort btimePort2 =
	{
		{
		{"Right",	I2_RIGHT,	0x01,	I_LOW},
		{"Left",		I2_LEFT,		0x02,	I_LOW},
		{"Up",		I2_UP,		0x04,	I_LOW},
		{"Down",		I2_DOWN,		0x08,	I_LOW},
		{"Button 1",I2_B1,		0x10,	I_LOW},
		{"Unknown",	0,				0x20,	I_LOW},
		{"Unknown",	0,				0x40,	I_LOW},
		{"Unknown",	0,				0x80,	I_LOW},
		}
	};

InputPort btimePort3 =
	{
		{
		{"Start 1",	I_START1,	0x01,	I_LOW},
		{"Start 2",	I_START2,	0x02,	I_LOW},
		{"Tilt",		I_TILT,		0x04,	I_LOW},
		{"Unknown",	0,				0x08,	I_LOW},
		{"Unknown",	0,				0x10,	I_LOW},
		{"Unknown",	0,				0x20,	I_LOW},
		{"Coin 1",	I_COIN1,		0x40,	I_HIGH | I_CPU_NMI(0)},
		{"Coin 2",	I_COIN2,		0x80,	I_HIGH | I_CPU_NMI(0)},
		}
	};

static highscore_t highscore[] =
	{
	{0x0033,0x27,0x00,0xFF},
	{0,-1}
	};

Cbtime::Cbtime()
{
SetName("btime");							//set romset name
SetScreen(256,256,ROTATE_270);
SetHighScoreInfo(highscore);
SetDip(0,dip1);
SetDip(1,dip2);
SetPort(0,&btimePort1);
SetPort(1,&btimePort2);
SetPort(2,&btimePort3);
AddROM("aa04.9b",	0xC000,0x1000,0x368a25b5,ROM_CPU1);
AddROM("aa06.13b",0xD000,0x1000,0xb4ba400d,ROM_CPU1);
AddROM("aa05.10b",0xE000,0x1000,0x8005bffa,ROM_CPU1);
AddROM("aa07.15b",0xF000,0x1000,0x086440ad,ROM_CPU1);
AddROM("ab14.12h",0xF000,0x1000,0xf55e5211,ROM_CPU2);
AddROM("aa12.7k",	0x0000,0x1000,0xc4617243,ROM_VROM1);
AddROM("ab13.9k",	0x1000,0x1000,0xac01042f,ROM_VROM1);
AddROM("ab10.10k",0x2000,0x1000,0x854a872a,ROM_VROM1);
AddROM("ab11.12k",0x3000,0x1000,0xd4848014,ROM_VROM1);
AddROM("aa8.13k",	0x4000,0x1000,0x8650c788,ROM_VROM1);
AddROM("ab9.15k",	0x5000,0x1000,0x8dec15e6,ROM_VROM1);
AddROM("ab00.1b",	0x0000,0x0800,0xc7a14485,ROM_VROM2);
AddROM("ab01.3b",	0x0800,0x0800,0x25b49078,ROM_VROM2);
AddROM("ab02.4b",	0x1000,0x0800,0xb8ef56c3,ROM_VROM2);
AddROM("ab03.6b",	0x0000,0x0800,0xd26bc1f3,ROM_VROM3);
}

CMachine *Cbtime::CreateMachine()
{
return(new CBurgerTimeMachine());
}
